import javax.swing.*;
import java.awt.*;
import java.text.*;
import java.awt.event.*;
import java.io.*;

// class to display Frame showing letter distributions
// called by "Show Letter Distribution" button on monoCard

class DistFrame extends JFrame {
	
	private JTextArea textArea;
	
	/**
	 * Constructor
	 */
	
	public DistFrame() //(int ic, String s)
	{
	}
	
	public DistFrame(double ic, String s){
	   super("Letter Distribution and I.C.");
	   
	   Container container = getContentPane();
	   container.setLayout(new FlowLayout());
	   NumberFormat form = NumberFormat.getInstance(); //format for ic
       form.setMaximumFractionDigits(5);
      
	   textArea = new JTextArea("I.C. = " + form.format(ic) + "\n\n" + s, 30, 15);
       textArea.setFont(new Font("monospaced",Font.PLAIN,12));
 	   container.add(textArea);
	   setSize(120,550);
	   setResizable(false);
	   setVisible(true);

	}

}
